11 In-Class work

11.1 1) Show a map outline of Iowa and Illinois (similar to Minnesota map upstream)

IAandIL <- states %>%
  filter(name %in% c('Iowa', 'Illinois')) %>%
  st_transform(2163) 

mapview(IAandIL)

11.2 2) Subset LAGOS data to these sites, how many sites are in Illinois and Iowa combined? How does this compare to Minnesota?

#Subset lakes based on spatial position
IAandIL_lakes <- spatial_lakes[IAandIL,]

nrow(IAandIL_lakes)
## [1] 16466
nrow(minnesota_lakes)
## [1] 29038

Illinois and Iowa have 16,466 sites. Minnesota has 29,038 sites. This is nearly double the number of sites, compared to Illinois and Iowa combined.

11.3 3) What is the distribution of lake size in Iowa vs. Minnesota?

  • Here I want to see a histogram plot with lake size on x-axis and frequency on y axis (check out geom_histogram)
  • make histogram log
iowa <- states %>%
  filter(name == 'Iowa') %>%
  st_transform(2163)
iowa_lakes <- spatial_lakes[iowa,]
iowa_lakes$state <- 'Iowa' 
minnesota_lakes$state <- 'Minnesota'

IAandMN_lakes <- bind_rows(iowa_lakes, minnesota_lakes)

names(IAandMN_lakes)
##  [1] "lagoslakeid"       "nhdid"             "gnis_name"        
##  [4] "lake_area_ha"      "lake_perim_meters" "nhd_fcode"        
##  [7] "nhd_ftype"         "iws_zoneid"        "hu4_zoneid"       
## [10] "hu6_zoneid"        "hu8_zoneid"        "hu12_zoneid"      
## [13] "edu_zoneid"        "county_zoneid"     "state_zoneid"     
## [16] "elevation_m"       "state"             "geometry"
ggplot(IAandMN_lakes) + aes(x=lake_area_ha, fill = state) +geom_histogram()+ scale_x_log10() + ylab('Frequency') +xlab('Lake Size in Hectares') + facet_wrap(vars(state))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

There are more lakes in Minnesota than in Iowa, but the distribution of lakes is similar. For both states there are a greater number of smaller lakes, and a smaller number of large lakes.

11.4 4) Make an interactive plot of lakes in Iowa and Illinois and color them by lake area in hectares

mapview(IAandIL_lakes, zcol = "lake_area_ha", at = c(0, 5, 10, 100, 250, 500, 750, 1000, 5000, 10000))

11.5 5) What other data sources might we use to understand how reservoirs and natural lakes vary in size in these three states?

During the different seasons, and different conditions such as drought, lakes will vary in the amount of water they hold. It would be insightful to find a data source that included depth information, and variance in size and depth throughout the year. This would be very helpful in understanding how lakes differ between these states. It may also be interesting to see what different states’ definitions are for lakes, and to see if that may influence the data when looking at the number of lakes and their sizes in the different states.